<!DOCTYPE html>
<html>
<head>
  <title>blog</title>
  <%= csrf_meta_tags %>
  <%= csp_meta_tag %>
  <%= stylesheet_link_tag 'application', media: 'all',
                          'data-turbolinks-track': 'reload' %>
  <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
  <!--[if lt IE 9]>
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js">
  </script>
  <![endif]-->
</head>
<body>

<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<header class="navbar navbar-fixed-top navbar-inverse">
  <div class="container">
    <%= link_to "我的博客", '/', id: "logo" %>
    <nav>
      <ul class="nav navbar-nav navbar-right">
        <li><%= link_to "主页", articles_path %></li>
        <li><%= link_to '写博客', new_article_path %></li>

        <% if current_user %>
          <li><%= link_to('退出', destroy_user_session_path, :method => :delete) %></li>
          <li><%= link_to('修改密码', edit_registration_path(:user)) %></li>
        <% else %>
            <li><%= link_to('登录', new_session_path(:user)) %></li>
            <li><%= link_to('注册', new_registration_path(:user)) %></li>
        <% end %>
      </ul>
    </nav>
  </div>
</header>
<div class="container">
  <%= yield %>
</div>
</body>
</html>